package com.denso.store.admin.templategroup;

import com.denso.store.common.model.TemplateGroup;

import java.util.Date;
import java.util.List;

/**
 * Created by lijian on 2017/10/24.
 */
public class TemplateGroupService {

    private static final TemplateGroup dao = new TemplateGroup();

    public List<TemplateGroup> getAll() {
        return dao.find("select * from template_group order by id");
    }

    public TemplateGroup findById(int id) {
        return dao.findById(id);
    }

    public boolean save(TemplateGroup templateGroup) {
        return templateGroup.save();
    }

    public boolean update(TemplateGroup templateGroup) {
        templateGroup.setUpdateTime(new Date());
        return templateGroup.update();
    }

    public boolean deleteById(int id) {
        return dao.deleteById(id);
    }
}
